<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/purchaseinfo/stock_in/q_stock_in.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/purchaseinfo/stock_in/q_stock_in.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Stock_in',
                footer: "Foots",
                cnName: '入库单',
                name: 'stock_in/q_stock_in',
                url: "/q_stock_in/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({"Voucher_sub":"","Goods_num":"","Total_price":"","Tax_exclusive_total_price":"","Supplier":"","WHSE_no":"","Remark":"","Attachment":"","Image":"","Supplier_key":""});
            const editFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub"},
                               {"title":"数量","field":"Goods_num","type":"text"},
                               {"title":"总价","field":"Total_price","type":"text"},
                               {"title":"无税总价","field":"Tax_exclusive_total_price","type":"text"}],
                              [{"dataKey":"供应商客户","data":[],"title":"供应商","field":"Supplier","type":"select"},
                               {"dataKey":"一级仓库","data":[],"title":"入库机构","field":"WHSE_no","type":"select"},
                               {"title":"备注","field":"Remark","colSize":6,"type":"text"}],
                              [{"title":"附件","field":"Attachment","type":"file"},
                               {"title":"图片","field":"Image","type":"img"}],
                              [{"title":"供应商ket","field":"Supplier_key","type":"text"}]]);
            const searchFormFields = ref({"Voucher_sub":"","Supplier":"","AuditStatus":"","CreateDate":"","WHSE_no":"","AuditDate":""});
            const searchFormOptions = ref([
                [{"title":"单据编码","field":"Voucher_sub","type":"like"},
            {"dataKey":"供应商客户","data":[],"title":"供应商","field":"Supplier","type":"select"},
            {"dataKey":"一级仓库","data":[],"title":"入库机构","field":"WHSE_no","type":"select"}],
            [
            {"dataKey":"audit","data":[],"title":"审核状态","field":"AuditStatus","type":"select"},{"title":"审核时间","field":"AuditDate","type":"datetime"},
            {"title":"创建时间","field":"CreateDate","type":"datetime"}]]);
            const columns = ref([{field:'Voucher_sub',title:'单据编码',type:'string',link:true,width:180,align:'left',sort:true},
                       {field:'Goods_num',title:'数量',type:'float',width:80,align:'left'},
                       {field:'Total_price',title:'总价',type:'decimal',width:110,align:'left'},
                       {field:'Tax_exclusive_total_price',title:'无税总价',type:'decimal',width:110,align:'left'},
                       {field:'Supplier',title:'供应商',type:'string',bind:{ key:'供应商客户',data:[]},width:220,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'Attachment',title:'附件',type:'file',width:110,align:'left'},
                       {field:'Image',title:'图片',type:'img',width:110,align:'left'},
                       {field:'WHSE_no',title:'入库机构',type:'string',bind:{ key:'一级仓库',data:[]},width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Stock_in',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'Supplier_key',title:'供应商ket',type:'string',width:220,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "入库单明细",
                table: "q_stock_inList",
                columns: [{field:'Voucher_sub',title:'采购单编码',type:'string',width:150,align:'left',sort:true},
                       {field:'Stock_inList',title:'ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Stock_in',title:'父级ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'Goods_sub',title:'商品编码',type:'string',width:110,align:'left'},
                       {field:'Goods_name',title:'商品名称',type:'string',width:220,align:'left'},
                       {field:'Goods_size',title:'规格',type:'string',width:110,align:'left'},
                       {field:'Goods_num',title:'数量',type:'float',width:110,edit:{type:'number'},require:true,align:'left'},
                       {field:'Cost_price',title:'成本价',type:'decimal',width:110,edit:{type:'number'},require:true,align:'left'},
                       {field:'Total_price',title:'总价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Tax_rate',title:'税率',type:'decimal',bind:{ key:'税率',data:[]},width:110,require:true,align:'left'},
                       {field:'Tax_exclusive',title:'无税成本',type:'decimal',width:110,require:true,align:'left'},
                       {field:'Tax_exclusive_total_price',title:'无税总价',type:'decimal',width:110,require:true,align:'left'},
                       {field:'WHSE_name',title:'库位名称',type:'string',bind:{ key:'库位编码',data:[]},width:120,edit:{type:'select'},require:true,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,edit:{type:''},align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AuditStatus',title:'审核状态',type:'int',width:110,hidden:true,align:'left'},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Purchase_ID',title:'采购ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'goodsInventoryWarehouseXm',title:'库存id',type:'guid',width:110,hidden:true,align:'left'}],
                sortName: "Goods_sub",
                key: "Stock_inList"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
